var mod_fwk_base = Backbone.Model.extend({
	defaults: function(){
		return {
			'dateCreate': new Date().getTime(),
			'dateMod': new Date().getTime(),
            'note': 'none'
		};
	},
	// initialize: function(){
		// this.bind('change', this.setDateMod);
	// },
	get : function(attr) {
		if ( typeof this[attr] == 'function') {
			return this[attr]();
		}
		return Backbone.Model.prototype.get.call(this, attr);
	},
	setDateMod: function(){
		this.set('dateMod', new Date().getTime());
	}
})
/**
 *toolbar 
 */
var mod_fwk_base_toolbar = Backbone.Model.extend({
    defaults: {
        toolbarid: '-header',
        title: null,
        description: null,
        buttons: new Array()
    },
    initialize: function(){
        this.set('buttons', new Array());
        this.set('title', null);
        this.set('description', null);
        this.set('toolbarid', '-header');
    },
    setToolbarId: function(pageId){
        this.set('toolbarid', pageId+ '-header');
    },
    addButton: function(icon, label, url){
        var buttons = this.get('buttons');
        var buttonObj = {
            id: 'toolbar-button-' + (buttons.length + 1),
            icon: null,
            label: null,
            url: '#'
        };
        if(typeof icon != 'undefined' && icon != null){
            buttonObj.icon = icon;
        }
        if(typeof label != 'undefined' && label != null){
            buttonObj.label = label;
        }
        if(typeof url != 'undefined' && url != null){
            buttonObj.url = url;
        }
        buttons.push(buttonObj);
        this.set('buttons', buttons);
    }
});



